package com.xj.edu.hotel.service.serviceImpl;

import com.xj.edu.hotel.domain.Authority;
import com.xj.edu.hotel.mapper.AuthorityMapper;
import com.xj.edu.hotel.service.AuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AuthorityServiceImpl implements AuthorityService {
    @Autowired
    private AuthorityMapper authorityMapper;
    @Override
    public List<Authority> findAuthorityByRoleId(String roleId) {
        return authorityMapper.findAuthorityByRoleId(roleId);
    }

    @Override
    public List<Authority> findRolePermission() {
        return authorityMapper.findRolePermission();
    }


    @Override
    public List<Authority> findAllPermission() {
        return authorityMapper.findAllPermission();
    }

    @Override
    public Authority findPermissionByDescription(String permissionType) {
        return authorityMapper.findPermissionByDescription(permissionType);
    }

    @Override
    public int updateRolePermission(Authority authority) {
        return authorityMapper.updateByPrimaryKeySelective(authority);
    }
}
